package com.wicket.okrcomponent.web.contorller;
import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;
import com.wicket.okrcomponent.biz.service.CalculationRulesService;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import com.wicket.okrcomponent.common.ro.OkrResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/comp/calculationRules/")
public class CalculationRulesController {
    @Autowired
    CalculationRulesService  calculationRulesService;
/**
   * D-获取当前时间服务(公共)
   */
    @PostMapping("obtainCurrentCycleServiceCom")
    public OkrResult<ObtainCurrentCycleServiceComRespDto> obtainCurrentCycleServiceCom(@RequestBody @Validated ObtainCurrentCycleServiceComReqDto reqDTO){
    return OkrResult.success(calculationRulesService.obtainCurrentCycleServiceCom(reqDTO));
    }
/**
   * D2-计算时间偏移得最终时间服务(公共)
   */
    @PostMapping("calculateTimeMigrationServiceCom")
    public OkrResult<CalculateTimeMigrationServiceComRespDto> calculateTimeMigrationServiceCom(@RequestBody @Validated CalculateTimeMigrationServiceComReqDto reqDTO){
    return OkrResult.success(calculationRulesService.calculateTimeMigrationServiceCom(reqDTO));
    }
/**
   * D2-计算数据集求和(公共)
   */
    @PostMapping("calculateSumOfMultipleNumCom")
    public OkrResult<CalculateSumOfMultipleNumComRespDto> calculateSumOfMultipleNumCom(@RequestBody @Validated CalculateSumOfMultipleNumComReqDto reqDTO){
    return OkrResult.success(calculationRulesService.calculateSumOfMultipleNumCom(reqDTO));
    }
}
  